package main

import (
	"encoding/json"
	"fmt"
	"log"
	"os"
)

func main() {
	fp, err := os.Open("./a.json")
	if err != nil {
		log.Fatal(err)
	}

	defer fp.Close()

	list := make([]interface{}, 0)

	if err := json.NewDecoder(fp).Decode(&list); err != nil {
		log.Fatal(err)
	}
	fmt.Println("end go")
	/*
		for _, item := range list {
			sublist, ok := item.([]interface{})

			if !ok {
				continue
			}

			for _, subitem := range sublist {
				mapData, ok := subitem.(map[string]interface{})

				if !ok {
					continue
				}

				a, ok := mapData["a"]

				if !ok {
					continue
				}

				// fmt.Println(a.(float64))

				b, ok := mapData["b"]

				if !ok {
					continue
				}
				fmt.Println("end:", a, b)
				//fmt.Println(b.(float64))
			}
		}
	*/
}
